/**
 * Actor Class
 *
 * A game entity possessing complex scripted behavior such as combat AI, stat
 * progression, dialogue trees, etc.  Broadly speaking, a "person".
 *
 * instanciation:
 * var actor = HIPPO.Lib.Actor.create();
 */
HIPPO.Lib.Actor = {

    /**
     * The Actor's HIPPO.Lib.Behavior object
     *
     * @type object
     */
    behavior: {},



    /**
     * The Actor's HIPPO.Lib.Presentation object
     *
     * @type object
     */
    presentation: {},



    /**
     * The Actor's HIPPO.Lib.Stats object
     *
     * @type object
     */
    stats: {},



    /**
     * Factory for the Actor class
     *
     * @return object An Actor instance
     */
    create: function() {
        "use strict";

        var this_class = this,
            this_obj   = {};

        // instantiate Actor class and initialize its properties
        this_obj = Object.create(this_class, {
            behavior: {
                value:        HIPPO.Lib.Behavior.create(),
                configurable: false,
                enumerable:   false,
                writeable:    false,
                get:          this_class.getBehavior,
                set:          this_class.setBehavior
            },
            presentation: {
                value:        HIPPO.Lib.Presentation.create(),
                configurable: false,
                enumerable:   false,
                writeable:    false,
                get:          this_class.getPresentation,
                set:          this_class.setPresentation
            },
            stats: {
                value:        HIPPO.Lib.Stats.create(),
                configurable: false,
                enumerable:   false,
                writeable:    false,
                get:          this_class.getStats,
                set:          this_class.setStats
            }
        });

        // lock up & deliver object
        return Object.seal(this_obj);
    },



    /**
     * Get the value of the behavior property
     *
     * @return object The behavior property
     */
    getBehavior: function() {
        "use strict";

        return this.behavior;
    },



    /**
     * Get the value of the presentation property
     *
     * @return object The presentation property
     */
    getPresentation: function() {
        "use strict";

        return this.presentation;
    },



    /**
     * Get the value of the stats property
     *
     * @return object The stats property
     */
    getStats: function() {
        "use strict";

        return this.stats;
    },

    

    /**
     * Throw an exception if someone attempts to set the behavior property
     */
    setBehavior: function() {
        "use strict";

        throw new Exception('Error: illegal attempt to set the value of HIPPO.Lib.Actor.behavior');
    },

    

    /**
     * Throw an exception if someone attempts to set the presentation property
     */
    setPresentation: function() {
        "use strict";

        throw new Exception('Error: illegal attempt to set the value of HIPPO.Lib.Actor.presentation');
    },

    

    /**
     * Throw an exception if someone attempts to set the stats property
     */
    setStats: function() {
        "use strict";

        throw new Exception('Error: illegal attempt to set the value of HIPPO.Lib.Actor.stats');
    }

};

// lock up Actor class
Object.freeze(HIPPO.Lib.Actor);
